package com.yj.suncity.bean;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

public class OfferListBean {
	
	 private String success;//": "1",
	 private String totalpage;//": "1",
	 private String msg;//": "获取信息成功",
	 private List<OfferBean> offerData;//": [
	 private List<OfferPersonBean> personData;//": [
	public OfferListBean(JSONObject json) {
		this.success = json.optString("success");
		this.totalpage = json.optString("totalpage");
		this.msg = json.optString("msg");
		this.offerData = new ArrayList<OfferBean>();
		this.personData= new ArrayList<OfferPersonBean>();
		JSONArray array=json.optJSONArray("data");
		if (array!=null) {
			for (int i = 0; i < array.length(); i++) {
				JSONObject item = array.optJSONObject(i);
				if (item!=null) {
					this.offerData.add(new OfferBean(item));
				}
			}
		}
		
		JSONArray array1=json.optJSONArray("data");
		if (array1!=null) {
			for (int i = 0; i < array1.length(); i++) {
				JSONObject item = array1.optJSONObject(i);
				if (item!=null) {
					this.personData.add(new OfferPersonBean(item));
				}
			}
		}
		
	}
	public String getSuccess() {
		return success;
	}
	public String getTotalpage() {
		return totalpage;
	}
	public String getMsg() {
		return msg;
	}
	public List<OfferBean> getOfferData() {
		return offerData;
	}
	public List<OfferPersonBean> getPersonData() {
		return personData;
	}

}
